<?php
class Cate_model extends CI_Model{
	var $_tableName = 'category';

    function __construct(){
        // Call the Model constructor
        parent::__construct();
    }
    public function getCateBySlug($slug){
    	$this->db->select('category_id, category_name, category_slug');
        $query = $this->db->get_where($this->_tableName, array('category_slug' => $slug));
        return $query->result_array();
    }
    public function getAllCate($limit = ''){
        $this->db->select('category_id, category_name, category_slug');
        $this->db->order_by('category_id', 'RANDOM');
        $query = $this->db->get($this->_tableName, $limit, $offset);
        return $query->result_array();
    }
}